﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace ManagerGame
{
    /// <summary>
    /// Class representing mr. Manager
    /// </summary>
    [Serializable]
    public class Manager
    {
        /// <summary>
        /// For Serializing: this must have parametreless constructor
        /// </summary>
        public Manager(){ }

        // TODO: Maybe singleton
        private static Manager instance;

        /// <summary>
        /// Manager instance
        /// </summary>
        public static Manager Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new Manager();
                    instance.Money = Options.MoneyAtStart;
                    instance.TurnCounter = 0;
                }
                return instance;
            }
        }

        public static void InitializeManager()
        {
            instance = null;

        }

        /// <summary>
        /// This method is used when manager is loaded from memory
        /// </summary>
        /// <param name="manager"></param>
        public static void SetManager(Manager manager)
        {
            instance = manager;
        }
        /// <summary>
        /// Amount of money
        /// </summary>
        public double? Money { get; set; }

        /// <summary>
        /// Which turn is currently running
        /// </summary>
        public int TurnCounter { get; set; }

        /// <summary>
        /// Business owned
        /// </summary>
        public List<Business> BusinessList { get; set; }

    }
}
